#include "stdafx.h"
#include "wf_selectinvert.h"
#include "pf_selection.h"

WF_SelectInvert::WF_SelectInvert(PF_Container& container,
        PF_GraphicView& graphicView)
        :PF_ActionInterface("Invert Selection",
                    container, graphicView) {
}


QAction* WF_SelectInvert::createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/) {
    QAction* action = new QAction(tr("Invert Selection"),  NULL);
	action->setIcon(QIcon(":/extui/selectinvert.png"));
    //action->zetStatusTip(tr("Inverts the current selection"));
    return action;
}


void WF_SelectInvert::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
    finish();
}

void WF_SelectInvert::trigger() {
    PF_Selection s(*container, graphicView);
    s.invertSelection();

    PF_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}

// EOF
